﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace SmartCity.EventHandle.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class tableEven : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "WF_Instance",
                columns: table => new
                {
                    InstanceId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    IndustryId = table.Column<int>(type: "int", nullable: false),
                    IndustryName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    TypeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    TypeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FormContent = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FlowState = table.Column<int>(type: "int", nullable: false),
                    FlowStateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    StartId = table.Column<int>(type: "int", nullable: false),
                    StartName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentNodeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentNodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CurrentOperatorId = table.Column<int>(type: "int", nullable: false),
                    CurrentOperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextNodeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextNodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NextOperatorId = table.Column<int>(type: "int", nullable: false),
                    NextOperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WF_Instance", x => x.InstanceId);
                });

            migrationBuilder.CreateTable(
                name: "WF_Record",
                columns: table => new
                {
                    RecordId = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    InstanceId = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NodeNo = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    NodeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorId = table.Column<int>(type: "int", nullable: false),
                    OperatorName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    OperatorOpinion = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ApproveStatus = table.Column<int>(type: "int", nullable: false),
                    ApproveStatusName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WF_Record", x => x.RecordId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WF_Instance");

            migrationBuilder.DropTable(
                name: "WF_Record");
        }
    }
}
